<template>
  <div>
    <van-field v-model="name" type="name" label="账号名" placeholder="请输入账号名"  />
    <van-field v-model="mobile" type="tel" label="手机号" placeholder="请输入手机号"  />
    <button @click="setweibo">确认</button>
  </div>
</template>

<script>
import {get,post} from '../utils/request'
export default {
    data(){
        return{
            token:this.$route.query.token,
            uid:this.$route.query.uid,
            mobile:'',
            name:''

        }
    },
    methods:{
        setweibo(){
            post('http://127.0.0.1:8000/user/weiboCallback/',{'token':this.token,'uid':this.uid,'mobile':this.mobile,'username':this.name})
            .then(resp=>{
                if(resp.data.code == 200){
                    localStorage.setItem("token",this.token)
                    this.$router.push("/homepage")
                    // alert('asd')
                }
            }).catch(err=>{
                console.log(err)
            })
        },
        setToken(){
            
            
        }
    },
    mounted(){
        // this.setweibo()
    }

}
</script>

<style>

</style>